home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-03-19 | 3.6 KB | 94 lines | [TEXT/MPS ] |
- #
- # File: MathTool.vulib
- #
- # Written by: David Gaxiola
- #
- # Contents: MathTool interface.
- #
- # Copyright © 1992-1997 Apple Computer, Inc. All rights reserved.
- #
- # Change history (most recent first):
- # Version Date Who Comments
- # ======= ======== === ===============
- # 2.2.0 02/12/97 JAS Added 'vers' resources to library.
- # These should always match tool version when tool is revved.
- # 01/16/97 JAS Changed return types to the appropriate kinds.
- # If there's an error, MathTool returns an empty
- # string in the returnValue.
- # 10/24/96 JAS Changed all return types to 'undefined'.
- # 10/30/92 PRT Add declarations for required tool services.
- # Make parameters 'undefined' to allow either numbers
- # or strings.
- # 8/11/92 DGG Created.
- #
- # Note: The file “MathTool User Guide” explains the services that MathTool
- # provides, and lists what each service takes as arguments and returns as results.
- # (For the services common to all Virtual User external tools, see the Virtual
- # User Language Reference manual.)
- # The file "MathTool ReadMe" contains last minute info on MathTool.
- # The script file “MathToolExample.vu" provides a few simple examples
- # of using MathTool.
- #
-
- task DefineMathGlobals()
- begin
- global gPi := "3.141592654";
- global gE := "2.718281828";
- end;
-
- tool MathTool s:'VUmt' # signature of MathTool
- begin
-
- # Services specific to MathTool:
-
- ## floating point operations:
- Service "fplus"('string', 'string') return 'string'; # floating point addition
- Service "fminus"('string', 'string') return 'string'; # floating point subtraction
- Service "ftimes"('string', 'string') return 'string'; # floating point multiplication
- Service "fdivide"('string', 'string') return 'string'; # floating point division
- Service "fcompare"('string', 'string') return 'integer'; # floating point compare
-
- ## trigonometric operations:
- Service "sin"('string') return 'string'; # sine function
- Service "cos"('string') return 'string'; # cosine function
- Service "tan"('string') return 'string'; # tangent function
- Service "asin"('string') return 'string'; # arcsine function
- Service "acos"('string') return 'string'; # arcosine function
- Service "atan"('string') return 'string'; # arctangent function
-
- ## exponetiation (power) operations:
- Service "sqrt"('string') return 'string'; # square root
- Service "power"('string', 'string') return 'string'; # exponetiation (a^b)
-
- ## logarithmic operations
- Service "ln"('string') return 'string'; # natural logarithm (base e)
-
- ### !!!!!!!!!!WARNING!!!!!!!!!!
- ### The following services are included for compatibility ONLY.
- ### Please use VU to perform integer math as these services WILL go away in
- ### the future.
- #
- # These services work on MC680x0 'LONG' integers. You can pass them either short integers
- # (ones between -32767 and 32767) or long integers enclosed in quotations.
- #
- Service "lplus"('integer', 'integer') return 'integer';
- Service "lminus"('integer', 'integer') return 'integer';
- Service "ltimes"('integer', 'integer') return 'integer';
- Service "ldivide"('integer', 'integer') return 'integer';
- Service "lcompare"('integer', 'integer') return 'integer';
- Service "lmod"('integer', 'integer') return 'integer';
-
- ### !!!!!!!!!!!!!!!!!!!!!!!!!!!
-
- # Services common to all Virtual User external tools:
-
- Service "Initialize"( 'string' ); # pass TRUE for target, FALSE for host
- Service "Cancel"( 'string' );
- Service "GetToolServices"() return 'list';
- Service "GetToolVersion"() return 'list';
- Service "Poll"( 'string' ) return 'string';
- Service "ServiceSupported"( 'string' ) return 'symbol';
- Service "Quit"();
-
- end;
-